package fr.umlv.ig.event;

import fr.umlv.ig.model.Train;

/**
 * Represents a event with a train.
 * @author jenseric
 * @author william
 *
 */
@SuppressWarnings("serial")
public class TrainEvent extends EventObjectWithType
{
	/**
	 * event : train is added
	 */
	public static final int TRAIN_ADDED = 1;
	
	/**
	 * event : train is remove
	 */
	public static final int TRAIN_REMOVE = 2;
	
	/**
	 * event : train is selected
	 */
	public static final int TRAIN_SELECTED = 3;
	
	/**
	 * event : train is unselected
	 */
	public static final int TRAIN_UNSELECTED = 4;

	/**
	 * Initializes a TrainEvent
	 * @param train the train concerned by the event.
	 * @param eventType the type of the event.
	 */
	public TrainEvent(Train train, int eventType) {
		super(train,eventType);
		if(eventType != TRAIN_ADDED && eventType != TRAIN_REMOVE
				&& eventType != TRAIN_SELECTED && eventType != TRAIN_UNSELECTED) {
			throw new IllegalArgumentException("Bad StationEvent type: "+eventType);
		}
	}

	
}
